package edu.hziee.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import edu.hziee.dao.ScoreDao;
import edu.hziee.models.Score;

@Controller
@RequestMapping("/score")
public class ScoreController {
	
	@Autowired
	private ScoreDao scoredao;

	@RequestMapping(method=RequestMethod.GET)
	public ModelAndView get(@RequestParam int sid){
		ModelAndView mav=new ModelAndView("score/score");
		List<Score> scores = scoredao.findById(sid);
		mav.addObject("scores",scores);
		return mav;
	}
}
